// 关联用
const {classInfo} = require("./classInfo.js") // 班级表
const {Dormitory} =require("./Dormitory") // 宿舍楼表
const {Floor} = require("./Floor") // 楼层表
const {RoomNo} = require("./RoomNo") // 房间号
const {Bednumber} = require("./Bednumber") // 床位表
const {StudentSInfon} = require("./StudentSInfon") // 学生信息表
const {AdminInfon} = require("./AdminInfon") // 管理员信息表
const {Cleaning} = require("./Cleaning") // 保洁人员表
const {Comment} = require("./Comments"); // 评论表
const {Getup} = require("./Getup") // 起床表
const {Destination} = require("./Destination")
const {Clean} = require("./Cleans") // 打扫记录表
const {RoomRate} = require("./RoomRate") // 房间价格表
const {StudentID} = require("./StudentID.js") // 学生学号表
const {RepairReport} = require("./RepairReport.js") // 报修表


// 宿舍楼和楼层一对多关联
Dormitory.hasMany(Floor);
Floor.belongsTo(Dormitory);

// 楼层和宿舍一对多关联
Floor.hasMany(RoomNo);
RoomNo.belongsTo(Floor);

// 宿舍和床位一对多关联
RoomNo.hasMany(Bednumber);
Bednumber.belongsTo(RoomNo);

// 床位和学生信息表一对一关联
Bednumber.hasOne(StudentSInfon);
StudentSInfon.belongsTo(Bednumber);

// 宿舍楼和管理员一对多关联
AdminInfon.hasMany(Dormitory);
Dormitory.belongsTo(AdminInfon);

// 保洁人员表和楼层表一对一关联
Floor.hasOne(Cleaning);
Cleaning.belongsTo(Floor);

// 评论表和房间表一对多关联
RoomNo.hasMany(Comment);
Comment.belongsTo(RoomNo);

// 评论表和管理员信息表一对多关联
AdminInfon.hasMany(Comment);
Comment.belongsTo(AdminInfon);

// 学生信息表和起床表一对多关联
StudentSInfon.hasMany(Getup);
Getup.belongsTo(StudentSInfon);

// 学生信息表和归宿表一对多关联
StudentSInfon.hasMany(Destination);
Destination.belongsTo(StudentSInfon);

// 学生信息表和打扫表一对多关联
StudentSInfon.hasMany(Clean);
Clean.belongsTo(StudentSInfon);

// 房间价格表和宿舍楼表一对多关联
RoomRate.hasMany(Dormitory)
Dormitory.belongsTo(RoomRate)

// 班级表和学生表一对多关联
classInfo.hasMany(StudentID)
StudentID.belongsTo(classInfo)

// 班级表和宿舍号一对多关联
classInfo.hasMany(RoomNo)
RoomNo.belongsTo(classInfo)

// 班级表和学生信息表一对多关联
classInfo.hasMany(StudentSInfon)
StudentSInfon.belongsTo(classInfo)

// 报修表和房间表一对一关联
RoomNo.hasOne(RepairReport);
RepairReport.belongsTo(RoomNo);
